<html>
<head>
<title>Documento sem t&iacute;tulo</title>
<link rel="stylesheet" type="text/css" href="css/estilo.css">



</head>

<body>
<div id="busca"><form action="?secao=busca" method="post">
                <input name="busca" type="text" value="" size="45" class="form-busca">
				<label>CATEGORIA</label>
                    
					  <select name="segmento" id="segmento" class="form-option" >
				      <option selected>TODAS</option>
                     <?php
                        $sql = mysql_query("SELECT * FROM categoria order by nome");
                        while($rs = mysql_fetch_assoc($sql)){
                        echo '<option value="'.$rs['codigo'].'">'.$rs['nome'].'</option>';
                         }
						 
					
                     ?>
				<input name="buscar" type="submit" value="Buscar" class="botao-busca">    
            </form> 
</div>	
<br/>
<br/>
<div>
 
	 <?php 
		   include ('conecta.inc');
		   
		   $sql=mysql_query("SELECT * FROM livros ORDER BY RAND() LIMIT 10");
		 	
           while($array=mysql_fetch_array ($sql)) {
		   
           $id = $array['codigo'];
		   $nome = $array['titulo'];
		   $foto = $array['imagem'];
		   $preco = $array['preco'];
		   $descricao = $array['descricao'];
		   $categoria = $array['categoria'];
		   
		?>
		   <div id="loja">
			<img src="imagens/img_produtos/<?php echo $foto ?>" class="img-livro">
			<p><a href="?secao=ver_livro&id=<?php echo $id ?>" class="produtos" ><?php echo $nome ?></a></p>
			<p style="font-style: italic; color:#6BA100;">por: R$ <?php echo $preco ?></a></p>
           </div>
		<?php 
		}
		 mysql_close($conexao);  
		?>
		
   </div>     

</body>
</html>
